package cn.lili.admin;

import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;

/**
 * @author ludi
 * @version 1.0
 * @describe
 * @date 2025/3/18 16:17
 */
@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {
    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http
                .cors().and() // 启用CORS配置 [[7]][[9]]
                .csrf().disable() // 若不需要CSRF保护，可禁用 [[10]]
                .authorizeRequests()
                .anyRequest().authenticated();
    }
}